home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
26
/
3
/
DISK2631.ZIP
/
EXAMP1.ZIP
/
UMEX230.BAS
< prev
next >
Wrap
BASIC Source File
|
1990-03-29
|
1KB
|
44 lines
'User's Manual Reference, Page 230.
'CGADEMO--demo of cga color and palette range
'Cycles through possible colors for background and palette.
DEFINT a-z
%CX = 60 'x location of circle
%CY = 30 'y location of circle
%RADIUS = 30
%NCIRCLE = 3
backgrd = 1
palet = 0
SCREEN 1,0
COLOR backgrd,palet 'change colors and palette
CLS
CALL drawcircles(backgrd, palet)
Letter$ = INPUT$(1)
WHILE Letter$ <> " "
SELECT CASE UCASE$(Letter$)
CASE "P"
palet = (palet + 1) MOD 2
CASE "B"
backgrd = backgrd + 1
IF backgrd > 31 THEN backgrd = 0
END SELECT
CALL drawcircles(backgrd, palet)
Letter$ = INPUT$(1)
WEND
SCREEN 0,0 : COLOR 15,0 'reset
END
SUB drawcircles(backgrd, palet)
COLOR backgrd, palet
FOR i = 1 to %NCIRCLE
CIRCLE ((i + 1) * %CX, (i + 1) * %CY), %RADIUS, i
PAINT ((i + 1) * %CX, (i + 1) * %CY), i, i
NEXT i
LOCATE 22,1
PRINT "Color";backgrd;",";palet
LOCATE 23,1 : PRINT "B/ackground, P/alette, or <Spacebar>"
END SUB